package LC;

/**
 * @ClassName LC547
 * @Description: TODO
 * @Author hl
 * @Date 2020/8/17
 * @Version V1.0
 **/
public class LC547 {
    public int findCircleNum(int[][] M) {
        if(M==null||M.length==0){
            return 0;
        }
        int len=M.length;
        boolean []visited=new boolean[len];
        int res=0;
        for(int i=0;i<len;i++){
            if(!visited[i]){
                seach(i,len,M,visited);
                res++;
            }
        }
        return  res;
    }
    public  static  void  seach(int i,int len,int [][]M,boolean[]visited){
        visited[i]=true;
        for(int k=0;k<len;k++){
            if(i<0||i>=len||visited[k]||M[i][k]==0){
                continue;
            }

        }

    }
}
